package com.ziytek.web.citizen.model.req;

import com.ziytek.web.citizen.constant.ServerConstant;
import com.ziytek.web.citizen.util.StringUtil;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;

/**
 * @author fenghx
 * @version v1.0
 * @className QueryBatteriesD
 * @descripton 查询充放电电流电压详情数据
 * @date 2023/4/20 14:23
 **/
@Data
@Slf4j
public class BatteryComprehensiveExportReq {
    /**
     * 机柜编号
     */
    @NotBlank(message = "机柜编号不能为空")
    private String cabinetNo;

    /**
     * Export path and file name
     */
    @NotBlank(message = "导出文件文件名不能为空")
    private String exportFileName;


    public boolean requestCheck() {
        return StringUtil.isNotEmpty(this.cabinetNo);
    }


    public void requestCheckFileName() {
        if (StringUtil.isEmpty(this.exportFileName)) {
            this.exportFileName = "电芯综合数据导出_" + DateFormatUtils.format(System.currentTimeMillis(), ServerConstant.DATE_FORMAT_TIME_STR);
        }
    }

}
